<template>
  <div class="container">
    <Title :title="info.title"></Title>
    <div class="news-ad" v-if="banner">
      <image  :src="banner" />
    </div>

    <div class="news-box">
      <div class="news-title normaltext">{{info.title}}</div>
      <div class="news-time">发布时间：{{info.inputtime1}}</div>
      <wxParse :content="html">
      </wxParse>

      <div class="news-content smalltext">
        {{info.description}}
      </div>
    </div>



    <Contact> </Contact>
  </div>

</template>
<script>
  const wxapp = getApp()
  import Line from '@/components/Line'
  import Contact from '@/components/contact'
  import wxParse from 'mpvue-wxparse'
  export default {
    data(){
      return{
        html : ``,
        info: {},
        id: 0,
        banner: {}
      }
    },
    components:{
      Line,
      Contact,
      wxParse
    },
    onShow() {
      this.id = this.$root.$mp.query.id
      this.getInfo()
      console.log(1);
    },
    methods: {
      getInfo() {
        wx.showLoading({
  title: '加载中',
})
        let that = this
        wx.request({
          url: wxapp.globalData.ROOT_URL, //仅为示例，并非真实的接口地址
          data: {
             service: 'App.Hong.GetDetailInfo',
             table: '4_news',
             id: that.id
          },
          header: {
              'content-type': 'application/json' // 默认值
          },
          success: function(res) {
            that.info = res.data.data.result
            that.banner = that.info['thumb']
            that.html = that.info['content']
            wx.hideLoading()
          }
        })
      }
    }
  }
</script>
<style scoped>
  .news-ad{
    height: 310rpx;
  }
  .news-ad image{
    width: 100%;
    height: 310rpx;
  }
  .background{
    height: 64rpx;
    background: #DBDBDB;
  }
  .news-box{
    padding: 20rpx 30rpx;
    background: #fff;
  }
  .news-box .news-title{
    text-align: center;
  }
  .news-box .news-time{
    font-size: 20rpx;
    text-align: center;

    color: #8E8181;
  }
  .news-box .news-content{
    padding-top: 20rpx;
    color: #8E8181;

  }
  .news-image{
    width: 100%;
    height: 260rpx;
  }
  .news-image image{
    width: 100%;
  }

</style>
